<!-- DataTables -->
<link rel="stylesheet"
	  href="./app/lib/datatables/media/css/dataTables.bootstrap.css">

<div ng-controller="order as gt">
	<section class="content-header">
		<h1>
			{{title}}<small></small>
		</h1>
	</section>
	<section class="content">
		<div class="box box-default">
			<div class="col-md-12">
				<div class="box-body">
					<alertdanger></alertdanger>
					<alertsuccess></alertsuccess>
					<form role="form">
						<div class="box-body">

								<div class="box-body" >
									<div class="form-group">
										<div class="box box-success">
											<div class="box-header with-border">
												<h3 class="box-title">搜索需要添加到订单的货物</h3>
											</div>
											<div class="box-body">
												<div class="form-group">
													<div class="col-md-3" ng-init="findallgoodstype();">
														<label>商品类型</label> <select ng-change="goodstypechange();"
																					ng-model="selectedgoodstype"
																					ng-options="gs.name for gs in goodstypeselect"
																					class="form-control select2" style="width: 100%;">
														<option ng－value="-1">--请选择--</option>
													</select>
													</div>
													<div class="col-md-3">
														<label>货物名称</label>
														<input maxlength="20"
															   ng-model="productname" class="form-control" type="text"
															   placeholder="请输入货物名称" value="" />
													</div>
													<div class="col-md-3">
														<label>货号</label>
														<input maxlength="20"
															   ng-model="psn" class="form-control" type="text"
															   placeholder="请输入货号" value="" />
													</div>
												</div>

											</div>
											<div class="box-body">
												<div class="form-group">
													<button ng-click="searchdataTableCustom();" class="btn btn-block btn-success btn-sm">检索</button>
												</div>
											</div>
										</div>
										<div class="col-xs-12">
											<div class="box">
												<div class="box-header"></div>
												<div class="box-body" >
													<table datatable="" dt-options="gt.dtOptions"
														   dt-columns="gt.dtColumns"
														   dt-instance="gt.dtInstance"
														   class="table table-striped table-bordered"></table>
												</div>
											</div>
										</div>
									</div>

									<div class="col-xs-12">
										<div class="box">
											<div class="box-header">
												<h3 class="box-title">已添加到订单的货物</h3>
											</div><!-- /.box-header -->
											<div class="box-body table-responsive no-padding">
												<table class="table table-hover">
													<tr>
														<th>货物编号</th>
														<th>图片</th>
														<th>货物名称</th>
														<th>成本价格</th>
														<th>会员价格</th>
														<th>库存</th>
														<th>操作</th>
													</tr>
													<tr ng-repeat="at in selectedproducts track by $index">
														<td>{{at.id}}</td>
														<td><img class="img-responsive pad" style="width: 50px;height: 50px;" src="{{at.mainimg}}" alt="Photo"></td>
														<td>{{at.productname}}</td>
														<td>{{at.saleprice|currency:"¥"}}</td>
														<td>{{at.memberprice|currency:"¥"}}</td>
														<td>{{at.stock|number}}</td>
														<td><button ng-click="removeselectproduct($index);" class='btn btn-box-tool'>删除</button></td>
													</tr>

												</table>
											</div><!-- /.box-body -->
										</div><!-- /.box -->
									</div>
								</div>




							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">搜索会员地址及开票信息</h3>
								</div>
								<div class="box-body">
									<div class="form-group">
										<label>输入会员账号或者手机号</label> <input maxlength="20"
											ng-model="mobile" class="form-control" type="text"
											placeholder="请输入会员账号进行搜索">
									</div>
								</div>
								<div class="form-group">
									<button class="btn btn-default btn-block btn-sm"
										ng-click="filterSearchMemberDeliveraddressAndInvoice();">搜索会员地址及开票信息</button>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">会员地址搜索结果列表</h3>
								</div>

								<div class="box-body table-responsive no-padding">
									<table class="table table-hover">
										<tr>
											<th>收货人</th>
											<th>国家</th>
											<th>省份</th>
											<th>城市</th>
											<th>区域</th>
											<th>街道</th>
											<th>详细地址</th>
											<th>手机</th>
											<th>别名</th>
											<th>操作</th>
										</tr>
										<tr ng-repeat="at in memberdeliveraddresssearchresult">
											<td>{{at.consignee}}</td>
											<td>{{at.country}}</td>
											<td>{{at.province}}</td>
											<td>{{at.city}}</td>
											<td>{{at.district}}</td>
											<td>{{at.street}}</td>
											<td>{{at.detail}}</td>
											<td>{{at.mobile}}</td>
											<td>{{at.tag}}</td>
											<td><button
													ng-click="pushToSelectedMemberDeliveraddress($index,at)"
													class=".btn-xs">添加</button></td>
										</tr>
									</table>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">已添加到订单的收获地址</h3>
								</div>
								<div class="box-body">
									<div class="col-md-12">
										<table class="table table-hover">
											<tr ng-repeat="at in selectedmda">
												<td>{{at.consignee}}</td>
												<td>{{at.country}}</td>
												<td>{{at.province}}</td>
												<td>{{at.city}}</td>
												<td>{{at.district}}</td>
												<td>{{at.street}}</td>
												<td>{{at.detail}}</td>
												<td>{{at.mobile}}</td>
												<td>{{at.tag}}</td>
												<td><button
														ng-click="removeSelectedMemberDeliveraddress($index)"
														class=".btn-xs">删除</button></td>
											</tr>
										</table>
									</div>
								</div>
							</div>

							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">会员开票信息搜索结果列表</h3>
								</div>

								<div class="box-body table-responsive no-padding">
									<table class="table table-hover">
										<tr>
											<th>开票抬头</th>
											<th>操作</th>
										</tr>
										<tr ng-repeat="at in memberinvoicesearchresult">
											<td>{{at.invtitle}}</td>
											<td><button
													ng-click="pushToSelectedMemberInvoice($index,at)"
													class=".btn-xs">添加</button></td>
										</tr>
									</table>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">已添加到订单的开票信息</h3>
								</div>
								<div class="box-body">
									<div class="col-md-12">
										<table class="table table-hover">
											<tr ng-repeat="at in selectedmi">
												<td>{{at.invtitle}}</td>
												<td><button
														ng-click="removeSelectedMemberInvoice($index)"
														class=".btn-xs">删除</button></td>
											</tr>
										</table>
									</div>
								</div>
							</div>

							<div class="box box-success" ng-init="filterLogisticsBusiness();">
								<div class="box-header with-border">
									<h3 class="box-title">选择物流商</h3>
								</div>
								<div class="box-body">
									<div class="form-group">
										<div ng-repeat="at in logisticslists">
											<label> <input name="logisticsid" type="radio" ng-click="watchlogistics(at.id);"  class="flat-red">{{at.logisticsname}}
											</label>
										</div>
									</div>
								</div>
							</div>

							<div class="box box-success" ng-init="filterPayment();">
								<div class="box-header with-border">
									<h3 class="box-title">选择支付方式</h3>
								</div>
								<div class="box-body">
									<div class="form-group">
										<div ng-repeat="at in paymentlist">
											<label> <input name="paymentid" type="radio" ng-click="watchpayment(at.id);" ng-model="paymentid"  class="flat-red">{{at.name}}
											</label>
										</div>
									</div>
								</div>
							</div>



							<div class="form-group">
								<label>订单运费</label> <input maxlength="100" required="required"
									ng-model="freight" class="form-control" type="text"
									placeholder="请输入订单运费">
							</div>
							<div class="form-group">
								<label>订单总价</label> <input maxlength="100" ng-model="shouldpay"
									class="form-control" type="text" placeholder="请输入订单总价">
							</div>
						</div>
						<div class="box-footer">
							<button ng-show="savebtn.show" type="button"
								class="btn btn-primary" ng-click="save();">提交订单</button>
							<button ng-show="updatebtn.show" type="button"
								class="btn btn-primary" ng-click="update();">更新订单</button>
						</div>
					</form>
				</div>
			</div>
			<div class="box-footer"></div>
		</div>
	</section>
</div>
